package au.com.langdale.gwt.client.model;

/**
 * Defines the events that may be sent by a ModelContainer to a ModelListener.
 * 
 * @author adv
 *
 */
public interface ModelListener {
	/**
	 * This event indicates a change in the properties of the 
	 * given model object or that it has been selected or deleted.
	 * 
	 * @param model
	 */
	public void onModelChange(Object model);
	
	/**
	 * This event indicates a change in the properties of the
	 * container itself, such as its capacity or status.
	 * 
	 * Note: this event may be sent in addition to one of the 
	 * others.
	 * 
	 * @param container
	 */
	public void onChange(Object container);
	
	/**
	 * This event indicates that the population of Model
	 * objects in the container has changed.  Objects have
	 * been added or removed.
	 * 
	 * @param container
	 */
	public void onContentsChange(Object container);
	
	/**
	 * This event indicates that model object changes, 
	 * previously reported via onModelChange(),
	 * have been successfully processed.  (Processed nearly
	 * always means committed to a remote database.)
	 * 
	 * @param container
	 */
	public void onCommit(Object container);
};
